package com.wx.md.exception;


import com.baomidou.mybatisplus.extension.api.IErrorCode;

public class BusinessException extends RuntimeException implements IErrorCode {

    private long code;

    private String msg;

    public BusinessException(String message){
        super(message);
        this.msg = message;
    }

    public BusinessException(Long code, String message){
        super(message);
        this.code = code;
        this.msg = message;
    }

    public BusinessException(IErrorCode baseCodeEnum){
        this(baseCodeEnum.getCode(),baseCodeEnum.getMsg());
    }

    @Override
    public long getCode() {
        return code;
    }



    @Override
    public String getMsg() {
        return msg;
    }
}
